import vue from '@vitejs/plugin-vue';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from 'unplugin-vue-components/resolvers';

export default {
  server:{
    hmr:true,
    watch: {
      usePolling: true,   // 修复HMR热更新失效
    },
  },
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()],
    }),
  ],
  css: {
    modules: {
      localsConvention: 'camelCaseOnly'
    },
    preprocessorOptions: {
      // scss: {
      //   additionalData: `
      //     @import "../src/vant-rewrite.scss";
      //   `
      // }
    }
  }
};